package org.afs.gescol.core.model.references;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;
import org.scub.foundation.framework.core.model.BaseModel;

/**
 * Reference model for School SeriesDao.
 * @autor Kobla GBENYO (kobla.gbenyo@gmail.com)
 */
@Entity
@Table(name = "ref_series")
@AttributeOverrides({@AttributeOverride(name = "id", column = @Column(name = "series_id", nullable = false)),
    @AttributeOverride(name = "version", column = @Column(name = "series_version", nullable = false, unique = false)),
})
public class Series extends BaseModel {

    /** Serial Version UID. */
    private static final long serialVersionUID = -7089418152731254455L;

    /** School SeriesDao Short label. */
    @Column(name = "series_short_label")
    private String shortLabel;

    /** School SeriesDao Long label. */
    @Column(name = "series_long_label")
    private String longLabel;

    @ManyToOne
    @JoinColumn(name = "level_id")
    @ForeignKey(name = "fk_ref_series_ref_level_id")
    private Level seriesLevel;

    @ManyToOne
    @JoinColumn(name = "cycle_id")
    @ForeignKey(name = "fk_ref_series_ref_cycle_id")
    private Cycle seriesCycle;

    /**
     * Get the value of shortLabel.
     * @return the shortLabel
     */
    public String getShortLabel() {
        return shortLabel;
    }

    /**
     * Get the value of longLabel.
     * @return the longLabel
     */
    public String getLongLabel() {
        return longLabel;
    }

    /**
     * Set the value of shortLabel.
     * @param shortLabel the shortLabel to set
     */
    public void setShortLabel(String shortLabel) {
        this.shortLabel = shortLabel;
    }

    /**
     * Set the value of longLabel.
     * @param longLabel the longLabel to set
     */
    public void setLongLabel(String longLabel) {
        this.longLabel = longLabel;
    }

    /**
     * Get the value of seriesLevel.
     * @return the seriesLevel
     */
    public Level getSeriesLevel() {
        return seriesLevel;
    }

    /**
     * Set the value of seriesLevel.
     * @param seriesLevel the seriesLevel to set
     */
    public void setSeriesLevel(Level seriesLevel) {
        this.seriesLevel = seriesLevel;
    }

    /**
     * Get the value of seriesCycle.
     * @return the seriesCycle
     */
    public Cycle getSeriesCycle() {
        return seriesCycle;
    }

    /**
     * Set the value of seriesCycle.
     * @param seriesCycle the seriesCycle to set
     */
    public void setSeriesCycle(Cycle seriesCycle) {
        this.seriesCycle = seriesCycle;
    }

    @Override
    public boolean equals(Object other) {
        return equalsUtil(other);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

}
